package com.nameless.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.nameless.entity.Users;
import com.nameless.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author keluoyisi
 * @program: tong-parent
 * @description:
 * @date 2023-02-23 20:37:36
 */

@RestController
@RequestMapping("/system/admin")
public class AdminController {
    @Autowired
    private UserService userService;

    @RequestMapping("/selectAdmin/{name}")
    public Users getAdmin(@PathVariable String name){
        LambdaQueryWrapper<Users> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Users::getUserName,name);
       return userService.getOne(queryWrapper);
    }
}